import request from '@/utils/request'

export function listMenu(params) {
  return request({
    url: '/admin/menu/list',
    method: 'get',
    params
  })
}

export function getMenu(menu_id) {
  return request({
    url: `/admin/menu/info/${menu_id}`,
    method: 'get'
  })
}

export function getMenus() {
  return request({
    url: `/admin/menu/select`,
    method: 'get'
  })
}

export function delMenu(menu_id) {
  return request({
    url: `/admin/menu/delete/${menu_id}`,
    method: 'post'
  })
}

export function addMenu(data) {
  return request({
    url: '/admin/menu/create',
    method: 'post',
    data
  })
}

export function updateMenu(menu_id, data) {
  return request({
    url: `/admin/menu/update/${menu_id}`,
    method: 'post',
    data
  })
}
